<?php 
    $url = new Url();
    $controller = Yii::app()->controller->id;
    $action = Yii::app()->controller->action->id;
    $ac = $controller.'-'.$action;
?>
<div class="box1">
    <div class="title-red">
        <h3><span>Bảng kết quả</span></h3>
    </div>
    <div class="box-cont1">
        <div class="cont-box">
            <ul class="menu">
                <li class="active"><a id="mien_bac" href="javascript:void(0);" onclick="showKetqua('bac_sub','nam_sub','trung_sub');"><span><b>XỔ SỐ MIỀN BẮC</b></span></a>
                    <ul class="list_col" id="bac_sub" style="<?=$ac=="ketqua-index" || $ac=="ketqua-truyenthong" || $ac=="ketqua-dientoan123" || $ac=="ketqua-dientoan6x36" || $ac=="ketqua-thantai" ?"display: block;":"display: none;" ?>">    
                        <li><a class="<?=$ac=="ketqua-index"?"active":"" ?>" href="<?=$url->createUrl("ketqua/truyenthong") ?>"><span><b> Xổ số truyền thống</b></span></a></li>
                        <li><a class="<?=$ac=="ketqua-dientoan123"?"active":"" ?>" href="<?=$url->createUrl("ketqua/dientoan123") ?>"><span><b> Xổ số điện toán 123</b></span></a></li>
                        <li><a class="<?=$ac=="ketqua-dientoan6x36"?"active":"" ?>" href="<?=$url->createUrl("ketqua/dientoan6x36") ?>"><span><b> Xổ số điện toán 6x36</b></span></a></li>
                        <li class="no-bor"><a class="<?=$ac=="ketqua-thantai"?"active":"" ?>" href="<?=$url->createUrl("ketqua/thantai") ?>"><span><b> Kết quả thần tài</b></span></a></li>
                    </ul>
                </li>
                <li><a id="mien_nam" href="javascript:void(0);" onclick="showKetqua('nam_sub','bac_sub','trung_sub');"><span><b>XỔ SỐ MIỀN NAM</b></span></a>
                    <ul class="list_col" id="nam_sub" style="<?=$action=="miennam" && $controller=="ketqua" ? "display: block;":"display: none;" ?>">    
                        <?php for($i=0;$i<count($rowMNam);$i++){?>
                        <li class="<?=$i==count($rowMNam) ? "no-bor":""?>">
                        <a class="<?=$id==$rowMNam[$i]["id"] ?"active":""?>" href="<?=$url->createUrl("ketqua/miennam",array("id"=>$rowMNam[$i]["id"],"title"=>$rowMNam[$i]["name"]))?>"><?=$rowMNam[$i]["name"] ?>
                        </a>
                        </li>
                        <?php }?>
                    </ul>
                </li>
                <li><a id="mien_trung" href="javascript:void(0);" onclick="showKetqua('trung_sub','nam_sub','bac_sub');"><span><b>XỔ SỐ MIỀN TRUNG</b></span></a>
                    <ul class="list_col" id="trung_sub" style="<?=$action=="mientrung" && $controller=="ketqua" ? "display: block;":"display: none;" ?>">    
                        <?php for($i=0;$i<count($rowMTrung);$i++){?>
                        <li class="<?=$i==count($rowMTrung) ? "no-bor":""?>">
                        <a class="<?=$id==$rowMTrung[$i]["id"] ?"active":""?>" href="<?=$url->createUrl("ketqua/mientrung",array("id"=>$rowMTrung[$i]["id"],"title"=>$rowMTrung[$i]["name"]))?>"><?=$rowMTrung[$i]["name"] ?>
                        </a>
                        </li>
                        <?php }?>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="bottom-box1"> <span>&nbsp;</span> </div>
</div>
<script type="text/javascript">
    function showKetqua(div1,div2,div3){
        switch(div1){
            case 'bac_sub':
                $("#mien_bac").addClass("active");
                $("#mien_nam").removeClass("active");
                $("#mien_trung").removeClass("active");
                break;
            case 'nam_sub':
                $("#mien_nam").addClass("active");
                $("#mien_bac").removeClass("active");
                $("#mien_trung").removeClass("active");
                break;
            case 'trung_sub':
                $("#mien_trung").addClass("active");
                $("#mien_bac").removeClass("active");
                $("#mien_nam").removeClass("active");
                break;
        }
        showForm(div1);
        closeForm(div2);
        closeForm(div3);
    }
</script>
